*** DROP FIRMS WITH ONLY 1 OR 2 OBSERVATIONS *** 

capture confirm var firm_obs, exact
if c(rc) == 111 {
bysort bvdid: gen firm_obs = _N
}

drop if firm_obs < 3

*** DROP FIRMS WITH SUBSIDIARIES THAT MIGHT CONTRIBUTE TO REVENUES *** 

capture confirm var noofrecordedsubsidiaries
if c(rc) != 111 {
drop if noofrecordedsubsidiaries > 0 & ~missing(noofrecordedsubsidiaries)
}

capture confirm var noofrecsubsidiaries
if c(rc) != 111 {
drop if noofrecsubsidiaries > 0 & ~missing(noofrecsubsidiaries)
}

capture confirm var numrecsubsid
if c(rc) != 111 {
drop if numrecsubsid > 0 & ~missing(numrecsubsid)
}

*** DROP FIRMS THAT MIGHT HAVE MULTIPLE LOCATIONS
capture confirm var diffbranchcity
if c(rc) != 111 {
drop if diffbranchcity == 1 // THIS VAR IS 1 IF THE FIRM HAS BRANCHES THAT ARE LISTED IN DIFFERENT CITIES
}

